# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Simon Perry <aur [at] sanxion [dot] net>
# Contributor: Nicolas Pouillard http://nicolaspouillard.fr

pkgname=spiped
pkgver=1.6.2
pkgrel=3
pkgdesc="Secure pipe daemon"
arch=('loong64' 'x86_64')
url="http://www.tarsnap.com/spiped.html"
license=('BSD')
depends=('openssl' 'gcc-libs')
checkdepends=('procps-ng' 'valgrind')
source=("$pkgname-$pkgver.tar.gz::http://www.tarsnap.com/spiped/spiped-$pkgver.tgz")
sha512sums=('d16262a3e8be876ca1ef1aac8bb38fae91f523a9af0d488eb0dfa23e0b9db795d2a021e55f31095d92f5b94e4516e30ea23f537c3b14a2f1b9871297e26cda76')
b2sums=('ce9fe45223eec8bbb741eb3106b17a395347de2766c289def9897321cce9907e104b55752ff3b2c9c7deafd178aaeef1e8fa8afe82c2d25582004c8c92982df6')

build() {
  cd "$pkgname-$pkgver"

  make
}

check() {
  cd "$pkgname-$pkgver"

  make test USE_VALGRIND=1
}

package() {
  cd "$pkgname-$pkgver"

  make \
    MAN1DIR="$pkgdir/usr/share/man/man1" \
    BINDIR="$pkgdir/usr/bin" \
    install

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" COPYRIGHT
}
